package com.inet.receiver;

import java.util.HashMap;
import java.util.Map;

import com.inet.request.ServerRequest;
import com.inet.util.HttpUtil;
import com.inet.util.L;
import com.inet.util.Utils;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.Log;

public class BootCompletedReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		openCloud(context, intent);
		ServerRequest.sendICCID(context, Utils.getImei(context));
	}


	private void openCloud(Context pContext, Intent intent) {
		int isOpenCloud = Settings.System.getInt(pContext.getContentResolver(),
				"isOpenCloud", 0);
		L.i("BootCompletedReceiver isOpenCloud=============" + isOpenCloud);
		if (isOpenCloud == 1) {
			Intent connectIntent = new Intent();
			connectIntent.setAction("connected_action");
			connectIntent.putExtra("connected_action_key", true);
			pContext.sendBroadcast(connectIntent);
		} else {
			Intent connectIntent = new Intent();
			connectIntent.setAction("connected_action");
			connectIntent.putExtra("connected_action_key", false);
			pContext.sendBroadcast(connectIntent);
		}
	}

}
